<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<style>
		* {
			margin: 0;
			padding: 0;
		}
		 header {
			 height: 50px;
			 background-color: #f40;
		 }
		 footer {
			 height: 100px;
			 background-color: purple;
		 }
		 main {
			 background-color: blue;
			 /* 使用vh单位和calc计算函数计算main的高度 */
			 height: calc(100vh - 50px - 100px);
		 }
	</style>
</head>
<body>
	<div class="box">
		<header>header</header>
		<main>main主体</main>
		<footer>footer</footer>
	</div>
</body>
</html>